﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ShadowGame
{
    public class Brick : GameComponent
    {
        private Texture2D texture;
        
        public Brick(Game game) : base(null)
        {
            Random r = new Random();
            texture = game.Content.Load<Texture2D>(@"Images/BrickWall");
            animations.Add("idle", new Animation(texture,45,45,new Rectangle(0, 0, 45, 45),1,"idle"));
            float x = r.Next(game.Window.ClientBounds.Width);
            float y = r.Next(300, game.Window.ClientBounds.Height);
            worldPosition.X = x;
            worldPosition.Y = y;

            animations["idle"].LoopAnimation = true;
            animations["idle"].FrameLength = 0.5f;

            frameWidth = 45;
            frameHeight = 45;
            drawDepth = 0.825f;
            enabled = true;
            PlayAnimation("idle");
            CollisionRectangle = new Rectangle(0, 0, 20, 45);
        }

    }
}
